package com.jdiv.internalClasses;

import java.util.ArrayList;
import java.util.List;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.jdiv.kernel.JDivResources;

public class PictureManager {


	public List<Picture> pictureList;

	public PictureManager() {
	
		this.pictureList = new ArrayList<Picture>();
	}
	
	public void putScreen(int fileId, int graph) {
		
		this.pictureList.add(new Picture(0, 0, fileId, graph));
		
	}
	
	public void drawAll(SpriteBatch batch) {
		
		for (int i = 0; i < pictureList.size(); i++) {
			Picture p = pictureList.get(i);
			JDivImage img = JDivResources.listTextures.getJDivImage(p.fileId, p.graph);
			if (img != null) {
				batch.draw(img.textureRegion, p.x, p.y);
				pictureList.remove(i);
			}
		}
		
	}
	
}
